﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VirtualOperator
{
    public partial class RouteDetail : Form
    {
        private VirtualNetworkOperator administer;
        private UserConnection nc;
        private MainGUI main;
        private bool delete = false;
        public RouteDetail(UserConnection nc, VirtualNetworkOperator administer, MainGUI main)
        {
            InitializeComponent();
            try
            {
                foreach (VirtualNetwork.Link link in nc.links)
                {
                    listBox1.Items.Add(link);

                }
            }
            catch (Exception) { }
            this.nc = nc;
            this.administer = administer;
            this.main = main;
        }

        private void button1_Click(object sender, EventArgs e)
        {

            if (delete == true)
            {

                administer.CurrentVirtualNetwork.TeardownConnection(nc.ID);
                DateTime stopTime = DateTime.Now;
           
            }
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            delete = true;
        }

 

        private void button4_Click(object sender, EventArgs e)
        {
  
        }
    }
}
